import { FormlyFieldConfig } from '@ngx-formly/core';

export function minlengthValidationMessage(err, field) {
    return `至少${field.templateOptions.minLength}个字符`;
}

export function maxlengthValidationMessage(err, field) {
    return `不能超过${field.templateOptions.maxLength}个字符`;
}

export function minValidationMessage(err, field) {
    return `应小于${field.templateOptions.min}`;
}

export function maxValidationMessage(err, field) {
    return `不能大于${field.templateOptions.max}`;
}
export function IdCardValidatorMessage(err, field: FormlyFieldConfig) {
  return `"${field.formControl.value}" 无效的身份证号`;
}
export function mobilePhoneValidatorMessage(err, field: FormlyFieldConfig) {
  return `"${field.formControl.value}" 手机号码错误`;
}

export function licensePlateValidatorMessage(err, field: FormlyFieldConfig) {
  return `"${field.formControl.value}" 车牌号码格式错误`;
}
